home *** CD-ROM | disk | FTP | other *** search
- // GoToWebPageXCMD.c
- // Copyright © Michael D. Crawford. All Rights Reserved.
- // mail bug reports and enhancement suggestions to crawford@scruznet.com
- // get updates from:
- // http://www.webcom.com/wordserv/ or
- // http://www.wordservices.org/ once the InterNIC completes the registration
- // GoToWebPage url
- //
- // Version history
- // 1.0d1 MDC First release
-
- #include <HyperXCMD.h>
-
- #include "TestBedPrefix.h"
- #include "GoToWebPage.h"
-
- void HandleStrToPStr( Handle h, StringPtr str );
-
- #define kBatchTimeout 600
-
- #ifdef XCMD_TESTBED
- void CallXCmd( XCmdPtr pBPtr )
- #else
- pascal void main( XCmdPtr pBPtr )
- #endif
- {
- OSErr err;
- AEAddressDesc spellerAddr;
- Str255 strBuf;
-
- if ( pBPtr->paramCount != 1 ){
- pBPtr->returnValue = NewHandle( 9 );
- if ( pBPtr->returnValue )
- BlockMoveData( "paramErr", *( pBPtr->returnValue ), 9 );
- }
-
- HandleStrToPStr( pBPtr->params[ 0 ], strBuf );
-
- GoToWebPage( strBuf );
-
- return;
- }
-
-
- void HandleStrToPStr( Handle h, StringPtr str )
- {
- short size;
- char *p;
-
- // Convert a handle to a C string into a Pascal string
-
- p = *h;
- size = 0;
-
- while ( *p++ )
- size++;
-
- if ( size > 255 )
- size = 255;
-
- str[ 0 ] = (unsigned char)size;
-
- BlockMove( *h, &str[ 1 ], size );
-
- return;
- }